package com.technology.education.dslitem.module

import com.angcyo.dsladapter.DslAdapterItem
import com.angcyo.dsladapter.DslViewHolder
import com.google.android.material.imageview.ShapeableImageView
import com.technology.education.R
import com.technology.education.ext.loadImage

class ItemPublishImage : DslAdapterItem() {
    var imgUrl:String=""
    init {
        itemLayoutId = R.layout.item_publish_image
    }

    override fun onItemBind(
        itemHolder: DslViewHolder,
        itemPosition: Int,
        adapterItem: DslAdapterItem,
        payloads: List<Any>
    ) {
        super.onItemBind(itemHolder, itemPosition, adapterItem, payloads)
        itemHolder.v<ShapeableImageView>(R.id.iv_image)?.apply {
            loadImage(imgUrl,this)
        }
        itemHolder.click(R.id.iv_del,_clickListener)
        itemHolder.click(R.id.iv_image,_clickListener)
    }
}